(function() {
	//模拟下拉多选
	$(".selectMultiple").click(function(event) {
		$(this).select();
		$(".selectMultiple").click(function(event) {
			event.stopPropagation();
		});
		event.stopPropagation();
		var popdiv = $(this).children(".selectMultiple-pop");
		var popW = "auto";
		if(popdiv.width()<$(this).find(".mainC").width()){
		var popW = $(this).find(".mainC").width()-2;
		}
		if(popdiv.css("display") == "none"){			
			popdiv.css("width",popW).show();		
		}		
		var checkAllVal = $(this).find("input[type='checkbox'][name='cb_orderStatus_all']:checked");
		var checkVal = $(this).find("input[type='checkbox'][name='cb_orderStatus']:checked");
		var selectVal = i18n.verifyType_choose;
			if(checkAllVal.attr("checked")){
				selectVal = checkAllVal.next("span").text();
				popdiv.find("input[type='checkbox'][name='cb_orderStatus']").attr("checked", true);				
			}
			else{
				checkVal.each(function(i){        //循环拼装被选中项的值
					if(i==0){
						selectVal = $(this).next("span").text();
					}else{
						selectVal = selectVal +','+ $(this).next("span").text();
						}
  	 			});
			}
			
		$(this).find(".selectbox").val(selectVal);
		if(popdiv.css("display") == "block"){	
			$(this).find(".selBtn").click(function(){
				popdiv.css("display","none");
				});
		}
		$("html").click(function() {
			//$(this).find(".selectbox").val() = selectVal;
			popdiv.hide();			
		});
		
	});
	$(".selectMultiple_hken").click(function(event) {
		$(this).select();
		$(".selectMultiple_hken").click(function(event) {
			event.stopPropagation();
		});
		event.stopPropagation();
		var popdiv = $(this).children(".selectMultiple-pop");
		var popW = "auto";
		if(popdiv.width()<$(this).find(".mainC").width()){
		var popW = $(this).find(".mainC").width()-2;
		}
		if(popdiv.css("display") == "none"){			
			popdiv.css("width",popW).show();		
		}		
		var checkAllVal = $(this).find("input[type='checkbox'][name='cb_orderStatus_all']:checked");
		var checkVal = $(this).find("input[type='checkbox'][name='cb_orderStatus']:checked");
		var selectVal = i18n.verifyType_choose;
			if(checkAllVal.attr("checked")){
				selectVal = checkAllVal.next("span").text();
				popdiv.find("input[type='checkbox'][name='cb_orderStatus']").attr("checked", true);				
			}
			else{
				checkVal.each(function(i){        //循环拼装被选中项的值
					if(i==0){
						selectVal = $(this).next("span").text();
					}else{
						selectVal = selectVal +','+ $(this).next("span").text();
						}
  	 			});
			}
			
		$(this).find(".selectbox").val(selectVal);
		if(popdiv.css("display") == "block"){	
			$(this).find(".selBtn").click(function(){
				popdiv.css("display","none");
				});
		}
		$("html").click(function() {
			//$(this).find(".selectbox").val() = selectVal;
			popdiv.hide();			
		});
		
	});
})(); 